package ${basePackage}.service.system.impl;

import ${basePackage}.core.model.PageData;
import ${basePackage}.core.model.PageWrap;
import ${basePackage}.dao.system.dto.QuerySystemJobListDTO;
import ${basePackage}.dao.system.vo.SystemJobListVO;
import ${basePackage}.service.system.SystemJobListService;
import ${basePackage}.dao.system.SystemJobListMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemJobListServiceImpl implements SystemJobListService {

    @Autowired
    private SystemJobListMapper systemJobListMapper;

    @Override
    public PageData<SystemJobListVO> findPage(PageWrap<QuerySystemJobListDTO> pageWrap) {
        PageHelper.startPage(pageWrap.getPage(), pageWrap.getCapacity());
        List<SystemJobListVO> result = systemJobListMapper.selectList(pageWrap.getModel());
        return PageData.from(new PageInfo<>(result));
    }
}
